package com.cib.yym.homepage.service;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;


public class ReadItLaterConfigLoader {
	private static ReadItLaterConfigLoader instance = new ReadItLaterConfigLoader();
	private Properties propertie;
	
	private ReadItLaterConfigLoader()
	{
		propertie = new Properties(); 
		
		try {
			//System.out.println(getClass().getResource("/readItLaterConfig.properties").getPath());
			//URL path = this.getClass().getClassLoader().getResource("readItLaterConfig.properties"); 		
			//InputStream ins = new FileInputStream(new File(path.getFile()));			
			//propertie.load(ins);
			propertie.load(getClass().getResourceAsStream("/readItLaterConfig.properties"));
		} catch (IOException e) {			
			e.printStackTrace();
		} 
	}
	
	public static ReadItLaterConfigLoader getInstance()
	{
		return instance;
	}
	
	public String getValue(String key)
	{
		return propertie.getProperty(key);
	}
}
